package models

import (
	"product/entity"
	"product/utils"
)

/**
 *@author:zhengyilong
 *@email:1797344574@qq.com
 *@phone:13479394730
 *@DateTime:2021/12/17 15:36
 **/

//根据主键ID查询产品详细信息
func QueryProductMessage(id int)(pro entity.Products) {
	str := "select * from product_tb where id = ?"
	result := utils.FindObject(str, id)
	result.Scan(&pro.Id,&pro.Name,&pro.Producer,&pro.Createdate)
	return pro
}